import { axios } from '@/utils/request'

// api接口列表
const api = {
  list: '/presalesCustomer.log/list',
  all: '/presalesCustomer.log/all',
  detail: '/presalesCustomer.log/detail',
  add: '/presalesCustomer.log/add',
  edit: '/presalesCustomer.log/edit',
  delete: '/presalesCustomer.log/delete',
  import: '/presalesCustomer.log/import',
  getExpireLog: '/presalesCustomer.log/getExpireLog'
}

// 列表记录
export function list(params) {
  return axios({
    url: api.list,
    method: 'get',
    params
  })
}

export function getExpireLog(params) {
  return axios({
    url: api.getExpireLog,
    method: 'get',
    params
  })
}

export function all(params) {
  return axios({
    url: api.all,
    method: 'get',
    params
  })
}

// 详情信息
export function detail(params) {
  return axios({
    url: api.detail,
    method: 'get',
    params
  })
}

/**
 * 新增记录
 * @param {*} data
 */
export function add(data) {
  return axios({
    url: api.add,
    method: 'post',
    data
  })
}

/**
 * 编辑记录
 * @param {*} data
 */
export function edit(data) {
  return axios({
    url: api.edit,
    method: 'post',
    data
  })
}

/**
 * 删除记录
 * @param {*} data
 */
export function deleted(data) {
  return axios({
    url: api.delete,
    method: 'post',
    data: data
  })
}

/**
 * 导入excel
 * @param {*} data
 */
export function importExcel(data) {
  return axios({
    url: api.import,
    method: 'post',
    data
  })
}
